home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / SAT 2.3.8 / Demos / HeartQuest demo ƒ / HQAE.p < prev    next >
Text File  |  1995-07-15  |  2KB  |  53 lines

  1. {Stripped-down AppleEvent unit, so we don't have to include all the other junk.}
  2. {When I see interface files like this, I wonder if someone is trying to make fools of us.}
  3. {Don't Apple know anything about making API's that are *simple* and easy to grasp?}
  4. {I suppose they want to make sure that our compilers are busy.}
  5.  
  6. unit AppleEvents;
  7. interface
  8. {$IFC UNDEFINED THINK_PASCAL}
  9.     uses
  10.         Types, Quickdraw, Memory, Events;
  11. {$ENDC}
  12.  
  13.     const
  14.         kHighLevelEvent = 23;
  15.         kCoreEventClass = 'aevt';
  16.  
  17.         kAEOpenApplication = 'oapp';
  18.         kAEOpenDocuments = 'odoc';
  19.         kAEPrintDocuments = 'pdoc';
  20.         kAEQuitApplication = 'quit';
  21.         keyMissedKeywordAttr = 'miss';      { this attribute is read only }
  22.         typeWildCard = '****';
  23.         errAEDescNotFound = -1701;
  24.         errAEParamMissed = -1715;           { a required parameter was not accessed }
  25.         errAEEventNotHandled = -1708;       { The AppleEvent was not handled by any handler }
  26.  
  27.     type
  28.         AEKeyword = packed array[1..4] of CHAR;
  29.         AEEventClass = packed array[1..4] of CHAR;
  30.         AEEventID = packed array[1..4] of CHAR;
  31.         DescType = ResType;
  32.         AEDesc = record
  33.                 descriptorType: DescType;
  34.                 dataHandle: Handle;
  35.             end;
  36.         AEAddressDesc = AEDesc;             { an AEDesc which contains addressing data }
  37.         AEDescList = AEDesc;                { a list of AEDesc is a special kind of AEDesc }
  38.         AERecord = AEDescList;              { AERecord is a list of keyworded AEDesc }
  39.         AppleEvent = AERecord;              { an AERecord that contains an AppleEvent }
  40.         EventHandlerProcPtr = ProcPtr;
  41.  
  42.     function AEGetAttributePtr (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: Ptr; maximumSize: Size; var actualSize: Size): OSErr;
  43.     inline
  44.         $303C, $0E15, $A816;
  45.     function AEInstallEventHandler (theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: EventHandlerProcPtr; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  46.     inline
  47.         $303C, $091F, $A816;
  48.     function AEProcessAppleEvent (theEventRecord: EventRecord): OSErr;
  49.     inline
  50.         $303C, $021B, $A816;
  51.  
  52. implementation
  53. end.